<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" type="text/css"
          href="css/jquery/jquery-ui-1.8.23.custom.css" media="screen"/>
    <script type="text/javascript" src="js/jquery/jquery-1.8.0.min.js"></script>
    <script type="text/javascript"
            src="js/jquery/jquery-ui-1.8.23.custom.min.js"></script>
    <script type="text/javascript" src="js/test.js"></script>
    <style type="text/css">
        #winpop {
            width: 200px;
            height: 0px;
            position: absolute;
            right: 0;
            bottom: 0;
            border: 1px solid #666;
            margin: 0;
            padding: 1px;
            overflow: hidden;
            display: none;
        }

        #winpop .title {
            width: 100%;
            height: 22px;
            line-height: 20px;
            background: #FFCC00;
            font-weight: bold;
            text-align: center;
            font-size: 12px;
        }

        #winpop .con {
            width: 100%;
            height: 90px;
            line-height: 80px;
            font-weight: bold;
            font-size: 12px;
            color: #FF0000;
            text-decoration: underline;
            text-align: center
        }

        #silu {
            font-size: 12px;
            color: #666;
            position: absolute;
            right: 0;
            text-align: left;
            text-decoration: underline;
            line-height: 22px;
        }

        .close {
            position: absolute;
            right: 4px;
            top: -1px;
            color: #FFF;
            cursor: pointer
        }
    </style>
    <script type="text/javascript">
        function test() {
            $.ajax({
//			url : "declaration-getContainerInfo",
                url: "test-test5",
                cache: false,
                dataType: "json",
                success: function (data) {
                    alert(2);
                }
            });
        }


        // 		tips_pop();
        refresh();
        function refresh() {
            // 				setTimeout('tips_pop()', 3000);
            $.ajax({
                url: "../gtimp/test/test-refresh",
                dataType: "json",
// 			method : "post",
                success: function (data) {
                    $("#message").text("123123");
                }
            });
        }
        window.onload = function () {//加载
            document.getElementById('winpop').style.height = '0px';
            setInterval("tips_pop()", 5000);
        }
        function tips_pop() {
// 		refresh();
            var MsgPop = document.getElementById("winpop");
            var popH = parseInt(MsgPop.style.height);//将对象的高度转化为数字
            if (popH == 0) {
                MsgPop.style.display = "block";//显示隐藏的窗口
                show = setInterval("changeH('up')", 2);
            } else {
                hide = setInterval("changeH('down')", 2);
            }
        }
        function changeH(str) {
            var MsgPop = document.getElementById("winpop");
            var popH = parseInt(MsgPop.style.height);
            if (str == "up") {
                if (popH <= 100) {
                    MsgPop.style.height = (popH + 4).toString() + "px";
                } else {
                    clearInterval(show);
                }
            }
            if (str == "down") {
                if (popH >= 4) {
                    MsgPop.style.height = (popH - 4).toString() + "px";
                } else {
                    clearInterval(hide);
                    MsgPop.style.display = "none"; //隐藏DIV
                }
            }
        }

        /**
         * Check email format
         */
        function ischeckemail() {
            var email = document.getElementById("emailname").value;
            if (email != "") {
                var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
                isok = reg.test(email);
                if (!isok) {
                    alert("邮箱格式不正确，请重新输入！");
                    document.getElementById("emailname").focus();
                    return false;
                }
            }
        }

    </script>
</head>
<body>
<input type="text" id="emailname">
<input type="submit" value="检测Email地址格式是否正确" onClick="return ischeckemail()">


<input type="button" value="测试" onclick="test();"/>
<!-- 	刷新数值 -->
<!-- 	<input id="aa" type="text"> -->
<div id="silu">
    <button onclick="tips_pop()">3秒后会在右下角自动弹出窗口，如果没有弹出请点击这个按钮</button>
</div>
<div id="winpop">
    <div class="title">
        您有新的短消息！<span class="close" onclick="tips_pop()">×</span>
    </div>
    <a href="www.baidu.com">
        <div id="message" class="con"></div>
    </a>
</div>
</body>
</html>
